<template>
    <div>
        <!-- <mt-swipe
            class="swiper"
            :auto="2000"
            :showIndicators="false"
        >
            <mt-swipe-item
                v-for="(item, index) in bannerData"
                :key="index"
            >
                <img :src="item.imgUrl" />
            </mt-swipe-item>
        </mt-swipe> -->
        <img :src="infoSource.logo">
        <div class="title">
            <div>
                <p>{{infoSource.shop_name}}</p>
                <p>{{infoSource.address}}</p>
            </div>
            <div @click="openMap">
                地图/导航>
            </div>
        </div>
        <div class="headline">
            服务项目
        </div>
        <div class="cont">
            {{infoSource.service}}
        </div>
        <div class="headline">
            联系方式
        </div>
        <div class="cont">
            {{infoSource.mobile}}
        </div>
        <div class="headline">
            图文详情
        </div>
        <div
            v-html="infoSource.info"
            class="cont"
        >

        </div>
    </div>
</template>
<script>
import wxOpenAddress from '../../config/wxOpenAddress.js';
export default {
    name: "addressCont",
    data() {
        return {
            bannerData: [],
            infoSource: {}
        };
    },
    methods: {
        // 方法
        openMap() {
            let params = {
                url: location.href.split('#')[0],
            };
            this.$post("Index/getWxConfig", params)
                .then(res => {
                    if (res.code === 20000) {
                        wxOpenAddress(res.data, this.infoSource)
                    }
                })
                .catch(err => { });
        },
        infoData() {
            let params = {
                id: this.$route.query.shop_id
            };
            this.$post("Shop/getShopInfo", params)
                .then(res => {
                    if (res.code === 20000) {
                        this.infoSource = res.data
                    }
                })
                .catch(err => { });
        }
    },
    beforeCreate() {
        document.querySelector("body").setAttribute("style", "background-color:#fff");
    },
    created() {
        // 实例创建完成
        this.infoData();
    },
};
</script>
<style lang="less" scoped>
@import url("../../asset/css/addressCont");
</style>